home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / term / extras / source / gtlayout-source.lha / LTP_Atol.c < prev    next >
C/C++ Source or Header  |  1995-03-25  |  399b  |  27 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. ULONG __regargs
  10. LTP_Atol(STRPTR String)
  11. {
  12.     ULONG Value = 0;
  13.  
  14.     while(*String == ' ' || *String == '\t')
  15.         String++;
  16.  
  17.     while(*String)
  18.     {
  19.         if(*String >= '0' && *String <= '9')
  20.             Value = (Value * 10) + (*String++) - '0';
  21.         else
  22.             break;
  23.     }
  24.  
  25.     return(Value);
  26. }
  27.